package com.jing21.learn.elasticsearch.intf.query;

import com.jing21.learn.elasticsearch.intf.annotaion.DisableSourse;
import com.jing21.learn.elasticsearch.intf.annotaion.ESField;
import com.jing21.learn.elasticsearch.intf.enums.EsIndexTypeEnum;
import com.jing21.learn.elasticsearch.intf.enums.FieldValuePolicy;
import com.jing21.learn.elasticsearch.intf.enums.FilterType;
import com.jing21.learn.elasticsearch.intf.model.FriendCriclePo;
import lombok.Data;

import java.math.BigInteger;
import java.util.List;

/**
 * @author zhengjing
 * @version 1.0
 * @date: 2017/10/23 14:59
 */
@Data
@DisableSourse
public class FriendCricleQuery extends BaseIndexQuery<FriendCriclePo> {

    @ESField(value = "region", query = FilterType.WILDCARD, valuePolicy = FieldValuePolicy.START_WITH)
    private String areacode;

    @ESField(query = FilterType.TERM)
    private String themealias;

    @ESField(query = FilterType.TERM)
    private String classifycode;

    @ESField(value = "adduserid", query = FilterType.TERMS)
    private List<BigInteger> adduserids;

    @ESField(value = "id", query = FilterType.RANGE, valuePolicy = FieldValuePolicy.RANGE_LTE)
    private BigInteger lastid;

    @ESField(query = FilterType.MATCH_PHRASE,group = "must")
    private String content;

    @Override
    public EsIndexTypeEnum getEsIndexType() {
        return EsIndexTypeEnum.FRIEND_CRICLE;
    }

}
